package cn.gxa.edu_adm.servlet;

import cn.gxa.edu_adm.bean.Admin;
import com.alibaba.fastjson.JSON;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "GetHeadImgPathServlet",urlPatterns = "/getAdminInfo")
public class AdminInfoServlet extends HttpServlet {


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter writer = response.getWriter();
        writer.println(JSON.toJSONString(request.getSession().getAttribute("admin")));
        writer.flush();
        writer.close();
    }
}
